package com.luyun.frogpay.view.login;

import com.luyun.frogpay.base.baseclass.BaseResponse;
import com.luyun.frogpay.base.network.request.RetrofitFactory;
import com.luyun.frogpay.pojo.request.RequestLogin;
import com.luyun.frogpay.pojo.response.LoginRsp;

import javax.inject.Inject;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class LoginModel implements LoginContract.ILoginModel {

    @Inject
    public LoginModel() {
    }

    @Override
    public Observable<BaseResponse<LoginRsp>> login(RequestLogin requestLogin) {
        return RetrofitFactory.getInstence()
                .API()
                .login(requestLogin)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());

    }
}
